#include <stdio.h>
#include <time.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>

int main(int argc,const char* argv[])
{
	time_t current_time;
	for(int i=0;i<10;i++)
	{
		long int x;
		x = time(&current_time);
		char YMD[15] = {0};
    	char HMS[10] = {0};
    	char *cur_time = (char *)malloc(21*sizeof(char));
   	 	struct tm* now_time;

    	x = time(&current_time);
    	now_time = localtime(&x);

    	strftime(YMD, sizeof(YMD), "%F ", now_time);
    	strftime(HMS, sizeof(HMS), "%T", now_time);

    	strcpy(cur_time, YMD);
    	strncat(cur_time, HMS, 8);
		printf("%s\n",cur_time);
		sleep(1);
	}
    return 0;
}
